package com.bwie.controller;

import com.bwie.pojo.ItemCat;
import com.bwie.service.ItemCatService;
import com.bwie.utils.R;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author : LeiMingkun
 * @date : 2024-08-25 19:35
 * @description : itemCatController
 **/
@RestController
@RequestMapping("/platform/ItemCat")
public class ItemCatController {
    @Resource
    private ItemCatService itemCatService;

    @RequestMapping("/getTreeList")
    public R getTreeList(){
        return itemCatService.getTreeList();
    }

    @RequestMapping("/delTree")
    public R delTree(@RequestParam(name = "id") Long id){
        return itemCatService.delTree(id);
    }

    @RequestMapping("/insertData")
    public R insertData(@RequestBody ItemCat itemCat){
        return itemCatService.insertData(itemCat);

    }
}